﻿/***************************************************************
*       
* add by OceanHo 2015/8/24 15:34:11
*
****************************************************************/

using System;
using System.Collections.Generic;
using System.Text;

namespace oceanho.webapi.factory.httpCore
{
    /// <summary>
    /// 定义一个oceanho.webapi.factory框架的异常超类。所有框架里面抛出的异常，必须继承此超类
    /// </summary>
    public abstract class APIFrameworkException : Exception
    {
        /// <summary>
        /// 所有框架里面抛出的异常，必须继承此超类
        /// </summary>
        public APIFrameworkException()
            : this(string.Empty)
        {
        }

        /// <summary>
        /// 所有框架里面抛出的异常，必须继承此超类
        /// </summary>
        /// <param name="message"></param>
        public APIFrameworkException(string message)
            : base(message)
        {
        }
    }

    /// <summary>
    /// 定义一个框架操作无效异常类，继承自 APIFrameworkException
    /// </summary>
    public class APIFW_InvalidOperationException : APIFrameworkException
    {
        /// <summary>
        /// 框架操作无效异常类，继承自 APIFrameworkException
        /// </summary>
        public APIFW_InvalidOperationException()
            : this(string.Empty)
        {
        }

        /// <summary>
        /// 框架操作无效异常类，继承自 APIFrameworkException
        /// </summary>
        /// <param name="message"></param>
        public APIFW_InvalidOperationException(string message)
            : base(message)
        {
        }
    }

    /// <summary>
    /// 定义一个框架参数空异常类，继承自 APIFrameworkException
    /// </summary>
    public class APIFW_ArgumentNullException : APIFrameworkException
    {

        /// <summary>
        /// 框架参数空异常类，继承自 APIFrameworkException
        /// </summary>
        public APIFW_ArgumentNullException()
            : this(string.Empty)
        {
        }

        /// <summary>
        /// 框架参数空异常类，继承自 APIFrameworkException
        /// </summary>
        /// <param name="message"></param>
        public APIFW_ArgumentNullException(string message)
            : base(message)
        {
        }
    }

    /// <summary>
    /// 定义一个框架空引用异常类，继承自 APIFrameworkException
    /// </summary>
    public class APIFW_NullReferenceException : APIFrameworkException
    {

        /// <summary>
        /// 框架空异常类，继承自 APIFrameworkException
        /// </summary>
        public APIFW_NullReferenceException()
            : this(string.Empty)
        {
        }

        /// <summary>
        /// 框架空异常类，继承自 APIFrameworkException
        /// </summary>
        /// <param name="message"></param>
        public APIFW_NullReferenceException(string message)
            : base(message)
        {
        }
    }

    /// <summary>
    /// 定义一个框架参数异常类，继承自 APIFrameworkException
    /// </summary>
    public class APIFW_ArgumentException : APIFrameworkException
    {

        /// <summary>
        /// 框架参数异常类，继承自 APIFrameworkException
        /// </summary>
        public APIFW_ArgumentException()
            : this(string.Empty)
        {
        }

        /// <summary>
        /// 框架参数异常类，继承自 APIFrameworkException
        /// </summary>
        /// <param name="message"></param>
        public APIFW_ArgumentException(string message)
            : base(message)
        {
        }
    }

    /// <summary>
    /// 定义一个框架参数绑定转换异常类，继承自 APIFrameworkException
    /// </summary>
    public class APIFW_BinderConvertException : APIFrameworkException
    {
        /// <summary>
        /// 框架参数绑定转换异常类，继承自 APIFrameworkException
        /// </summary>
        public APIFW_BinderConvertException()
            : this(string.Empty)
        {
        }

        /// <summary>
        /// 框架参数绑定转换异常类，继承自 APIFrameworkException
        /// </summary>
        /// <param name="message"></param>
        public APIFW_BinderConvertException(string message)
            : base(message)
        {
        }
    }

    /// <summary>
    /// 定义一个上传文件操作，文件存在于服务上时的异常类
    /// </summary>
    public class FileUploadExistException : APIFrameworkException
    {
        /// <summary>
        /// 上传文件操作，文件存在于服务上时的异常类
        /// </summary>
        /// <param name="fileName"></param>
        public FileUploadExistException(string fileName)
        {
            this.FileName = fileName;
        }

        /// <summary>
        /// 上传文件服务器端保存名称
        /// </summary>
        public string FileName { get; private set; }
    }
}
